<?php

Raise::load('core.RaiseObject');

abstract class RaiseOAuthDataStore extends RaiseObject {
    
    /**
     * Fetch the customer based on the consumer key
     * @param string $consumer
     */
    public abstract function fetchConsumer($consumerKey);
    
    /**
     * Check if the token is valid or not
     * @param RaiseOAuthConsumer $consumer
     * @param RaiseOAuthRequest $token
     * @return boolean Return TRUE if the token is valid. FALSE otherwise.
     */
    public abstract function checkToken($consumer, $token);
    
    /**
     * Check if the nonce matches
     * @param RaiseOAuthConsumer $consumer
     * @param RaiseOAuthRequest $token
     * @return boolean Return TRUE if the token is valid. FALSE otherwise.
     */
    public abstract function checkNonce($consumer, $token);
    
    /**
     * 
     * @param RaiseOAuthRequestTokenRequest $request
     * @return RaiseOAuthRequestTokenResponse
     */
    public abstract function createRequestToken($request);
    
    /**
     * Create the access token based on access token with the verifier
     * @param RaiseOAuthAccessTokenRequest $request
     * @return RaiseOAuthAccessTokenResponse
     */
    public abstract function createAccessToken($request);
    
}
